/**
 * Permission 请求
 *
 * @date 2020-07-12
 * @author 逗号米
 */

import * as http from '@/http'
import * as api from '@/api/cms/crm/permission'

/**
 * 获取列表
 *
 * @param param
 * @return {Promise<any>}
 */
export const index = (param: any): Promise<any> => http.get(api.index, param)

/**
 * 查询
 *
 * @param param
 * @return {Promise<any>}
 */
export const query = (param: any): Promise<any> => http.get(api.query, param)

/**
 * 分组
 *
 * @param param
 * @return {Promise<any>}
 */
export const group = (param: any): Promise<any> =>http.get(api.group, param)

/**
 * 存储
 *
 * @param param
 * @return {Promise<any>}
 */
export const store = (param: any): Promise<any> => http.post(api.store, param)

/**
 * 显示
 *
 * @param id
 * @param param
 * @return {Promise<any>}
 */
export const show = (id: number, param: any): Promise<any> => http.get(api.show(id), param)

/**
 * 更新
 *
 * @param id
 * @param param
 * @return {Promise<any>}
 */
export const update = (id: number, param: any): Promise<any> => http.put(api.update(id), param)

/**
 * 更新
 *
 * @param id
 * @param param
 * @return {Promise<any>}
 */
export const destroy = (id: number, param: any): Promise<any> => http.del(api.destroy(id), param)
